/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package db;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
/**
 *
 * @author Scumm
 */
public class CDResponsable {

     private Statement sentencia;


    public ResultSet SeleccionarResponsables(int ninyo, Connection con) throws SQLException
    {
        ResultSet rs = null;

        try {
            sentencia = con.createStatement();
            rs = sentencia.executeQuery( "SELECT RESPONSABLE.* FROM RESPONSABLE INNER JOIN " +
                "(NINYO INNER JOIN CARGO ON NINYO.IdNinyo = CARGO.IdNinyo) ON " +
                "RESPONSABLE.IdResponsable = CARGO.IdResponsable Where ninyo.idninyo = " + ninyo + ";");

        } catch (SQLException ex) {
              throw  ex;
        }
        return rs;
    }
}
